package com.cn.zpark;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @PackageName: com.cn.zpark
 * @ClassName: ResponseDemo04
 * @Description:
 * @author: RZS
 * @date: 2022/4/13  8:31
 */
@WebServlet("/resp4.do")
public class ResponseDemo04 extends HttpServlet {
    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // 通过servlet访问WEB-INF下的login.html文件

        // 获取转发器
        RequestDispatcher requestDispatcher = request.getRequestDispatcher("/WEB-INF/login.html");
        // 转发
        requestDispatcher.forward(request, response);
    }
}
